package day11;

import java.util.Scanner;

/**
 * @author tongchen
 * @create 2023-03-16 23:24
 */
public class Main {
    public static void main(String[] args) {
        //创建输入对象
        Scanner scanner=new Scanner(System.in);
        int scan=scanner.nextInt();
        //定义最大值
        int maxCount=0;
        int count=0;
        int pre=0;
        int cur=0;
        while(scan!=0){
            cur=scan&1;
            if(cur==1){
                count++;
                if(count>maxCount){
                    maxCount=count;
                }
                pre=cur;
                scan=scan>>1;
            }
        }
        System.out.println(maxCount);
    }
}
